export default {
	/**
	 * toast提示
	 */
	toast(title, duration = 3000, mask = false, icon = 'none') {
		if (Boolean(title) === false) {
			return;
		}
		uni.showToast({
			title,
			duration,
			mask,
			icon
		});
	},
	/**
	 * 复制
	 */
	copy(content) {
		uni.setClipboardData({
			data: content,
			success: function() {
				uni.$u.toast("复制成功~");
			},
			fail: function() {
				uni.$u.toast("复制失败~");
			}
		});
	},
	isToFixedNum(value, num) {
		if (value) {
			let val = this.precisionTrue(value, num)
			return val
		} else {
			return 0
		}
	},
	// 电话隐私保护
	phoneChange(tel) {
		if (tel) {
			let result = tel.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
			return result
		} else {
			return tel
		}
	},
	// 打电话
	callup(mobile) {
		uni.makePhoneCall({
			phoneNumber: mobile //仅为示例
		});
	},

	// 判断token
	isToken() {
		return uni.getStorageSync('token') ? true : false
	},

}